package self.hoy.demo.cloud.sentinel;

import com.alibaba.csp.sentinel.adapter.servlet.callback.RequestOriginParser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * 演示提取参数（用于授权规则）
 * @author 三共小不
 * @date 2021/7/6
 */
@Component
public class OriginalDescriber implements RequestOriginParser {

    @Override
    public String parseOrigin(HttpServletRequest httpServletRequest) {
        return httpServletRequest.getParameter("name");
    }
}
